package java_class.GirlFriend_class;

public class GirlFriend {
    private String name;

    private int age;

    int height;

    // 设置获取
    public void setName(String name) {
        this.name = name;
    }

    public String getNmae() {
        return name;
    }

    public void setAge(int age) {
        if (age >= 18 && age <= 50) {
            this.age = age;
        } else {
            System.out.println("输入的数据违法");
        }
    }

    public int getAge() {
        return age;
    }

    public void sleep() {
        System.out.println("女朋友在睡觉");
    }

    public void eat() {
        System.out.println("女朋友在吃饭");
    }
}
